package org.wjm.manageStu.entity;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@Entity
@Table(name="exam_role")
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
public class Role implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 2427556062802038239L;

	@Id
	@GeneratedValue
	@Column(name="role_id",nullable=false)
	private Integer roleId;
	
	@Column(name="name",length=45,nullable=false)
	private String name;
	
	@ManyToMany(mappedBy="role")
	@JsonIgnoreProperties("role")
	private Set<User> user=new HashSet<User>();

	public Integer getRoleId() {
		return roleId;
	}

	public void setRoleId(Integer roleId) {
		this.roleId = roleId;
	}



	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Set<User> getUser() {
		return user;
	}

	public void setUser(Set<User> user) {
		this.user = user;
	}
	
	
	
}
